import 'package:flutter_swiper/flutter_swiper.dart';
import 'package:flutter/material.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';

class SwiperComponent extends StatelessWidget {
  final List swiperList;
  // swiperComponent(this.swiperList);
  const SwiperComponent({Key key, this.swiperList}) : super(key: key);

  @override
  Widget build(BuildContext context) {

    return Container(
      // height: MediaQuery.of(context).size.height / 5,
      width: MediaQuery.of(context).size.width,
      height: ScreenUtil().setHeight(302),
      child: Swiper(itemBuilder:(
        BuildContext context, int index) {
          return Image.network('${swiperList[index]['banner_cover']}');
        },
        itemCount: swiperList.length,
        pagination: SwiperPagination(margin: EdgeInsets.all(6)),
      ),
    );
  }
}